package com.bestv.engine.filter;

import com.bestv.engine.model.RecommendationItem;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Henry on 14-6-17.
 */
public class Filters {
    private List<Filter> filterChain;

    public Filters() {
        filterChain = new ArrayList<Filter>();
    }

    public boolean accept(RecommendationItem item) {
        for (Filter filter : filterChain) {
            if (!filter.accept(item))
                return false;
        }
        return true;
    }

    public void add(Filter filter) {
        filterChain.add(filter);
    }
}
